#include <glib.h>

gint main(gint argc, gchar **argv)
{
    GByteArray *barr = NULL;
    guint i = 0;

    barr = g_byte_array_new();

    g_byte_array_append(barr, (guint8 *)"World", 5);
    g_byte_array_prepend(barr, (guint8 *)"Hello", 5);

    g_print("barr:(len:%d)%s \n", barr->len, barr->data);
    g_print("barr->data: \n");
    for(i=0; i<barr->len; i++) {
        g_print("%c ", barr->data[i]);
    }
    g_print("\n");
    
    g_byte_array_free(barr, TRUE);

    return 0;
}